<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CheeseCameraDeviceMonitor: Cheese Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Cheese Reference Manual">
<link rel="up" href="libcheese.html" title="libcheese">
<link rel="prev" href="CheeseCameraDevice.html" title="CheeseCameraDevice">
<link rel="next" href="CheeseEffect.html" title="CheeseEffect">
<meta name="generator" content="GTK-Doc V1.29.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#CheeseCameraDeviceMonitor.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#CheeseCameraDeviceMonitor.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
                  <a href="#CheeseCameraDeviceMonitor.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_signals">  <span class="dim">|</span> 
                  <a href="#CheeseCameraDeviceMonitor.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libcheese.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="CheeseCameraDevice.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="CheeseEffect.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="CheeseCameraDeviceMonitor"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="CheeseCameraDeviceMonitor.top_of_page"></a>CheeseCameraDeviceMonitor</span></h2>
<p>CheeseCameraDeviceMonitor — Simple object to enumerate video devices</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.stability-level"></a><h2>Stability Level</h2>
<acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="returnvalue">CheeseCameraDeviceMonitor</span></a> *
</td>
<td class="function_name">
<a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-new" title="cheese_camera_device_monitor_new ()">cheese_camera_device_monitor_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-new-async" title="cheese_camera_device_monitor_new_async ()">cheese_camera_device_monitor_new_async</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="returnvalue">CheeseCameraDeviceMonitor</span></a> *
</td>
<td class="function_name">
<a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-new-finish" title="cheese_camera_device_monitor_new_finish ()">cheese_camera_device_monitor_new_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-coldplug" title="cheese_camera_device_monitor_coldplug ()">cheese_camera_device_monitor_coldplug</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-added" title="The “added” signal">added</a></td>
<td class="signal_flags">Action</td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-removed" title="The “removed” signal">removed</a></td>
<td class="signal_flags">Action</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitorClass" title="struct CheeseCameraDeviceMonitorClass">CheeseCameraDeviceMonitorClass</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-struct" title="struct CheeseCameraDeviceMonitor">CheeseCameraDeviceMonitor</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> CheeseCameraDeviceMonitor
</pre>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
CheeseCameraDeviceMonitor implements
 GInitable and  GAsyncInitable.</p>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;cheese/cheese-camera-device-monitor.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.description"></a><h2>Description</h2>
<p><a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> provides a basic interface for video device
enumeration and hotplugging.</p>
<p>It uses GstDeviceMonitor to list video devices. It is also capable to
monitor device plugging and emit a CheeseCameraDeviceMonitor::added or
CheeseCameraDeviceMonitor::removed signal when an event happens.</p>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="cheese-camera-device-monitor-new"></a><h3>cheese_camera_device_monitor_new ()</h3>
<pre class="programlisting"><a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="returnvalue">CheeseCameraDeviceMonitor</span></a> *
cheese_camera_device_monitor_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Returns a new <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> object. The initialization may block.
See <a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-new-async" title="cheese_camera_device_monitor_new_async ()"><code class="function">cheese_camera_device_monitor_new_async()</code></a> for the asynchronous version.</p>
<div class="refsect3">
<a name="cheese-camera-device-monitor-new.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> object.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cheese-camera-device-monitor-new-async"></a><h3>cheese_camera_device_monitor_new_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cheese_camera_device_monitor_new_async
                               (<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                                <em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
                                <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>Creates a new <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> object asynchronously. Callback
will be called when it is done. Use <a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-new-finish" title="cheese_camera_device_monitor_new_finish ()"><code class="function">cheese_camera_device_monitor_new_finish()</code></a>
to get the result.</p>
<p>See <a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-new" title="cheese_camera_device_monitor_new ()"><code class="function">cheese_camera_device_monitor_new()</code></a> for the synchronous version.</p>
<div class="refsect3">
<a name="cheese-camera-device-monitor-new-async.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>a <span class="type">GCancellable</span> or NULL</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a GAsyncReadyCallback to call when the initialization is finished</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data to pass to callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cheese-camera-device-monitor-new-finish"></a><h3>cheese_camera_device_monitor_new_finish ()</h3>
<pre class="programlisting"><a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="returnvalue">CheeseCameraDeviceMonitor</span></a> *
cheese_camera_device_monitor_new_finish
                               (<em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
                                <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Finishes creating a new <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> object.</p>
<div class="refsect3">
<a name="cheese-camera-device-monitor-new-finish.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>result</p></td>
<td class="parameter_description"><p>the GAsyncResult from the callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return location for errors, or NULL to ignore</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="cheese-camera-device-monitor-new-finish.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> object or NULL if error is set.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="cheese-camera-device-monitor-coldplug"></a><h3>cheese_camera_device_monitor_coldplug ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cheese_camera_device_monitor_coldplug (<em class="parameter"><code><a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> *monitor</code></em>);</pre>
<p>Enumerate plugged in cameras and emit ::added for those which already exist.
This is only required when your program starts, so be sure to connect to
at least the ::added signal before calling this function.</p>
<div class="refsect3">
<a name="cheese-camera-device-monitor-coldplug.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>monitor</p></td>
<td class="parameter_description"><p>a <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="CheeseCameraDeviceMonitorClass"></a><h3>struct CheeseCameraDeviceMonitorClass</h3>
<pre class="programlisting">struct CheeseCameraDeviceMonitorClass {
  void (*added)   (CheeseCameraDeviceMonitor *monitor,
                   CheeseCameraDevice        *device);
  void (*removed) (CheeseCameraDeviceMonitor *monitor,
                   CheeseCameraDevice        *device);
};
</pre>
<p>Class for <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a>.</p>
<div class="refsect3">
<a name="CheeseCameraDeviceMonitorClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="CheeseCameraDeviceMonitorClass.added"></a>added</code></em> ()</p></td>
<td class="struct_member_description"><p>invoked when a new video capture device is connected</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="CheeseCameraDeviceMonitorClass.removed"></a>removed</code></em> ()</p></td>
<td class="struct_member_description"><p>invoked when a video capture device is removed</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="CheeseCameraDeviceMonitor-struct"></a><h3>struct CheeseCameraDeviceMonitor</h3>
<pre class="programlisting">struct CheeseCameraDeviceMonitor;</pre>
<p>Use the accessor functions below.</p>
</div>
</div>
<div class="refsect1">
<a name="CheeseCameraDeviceMonitor.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="CheeseCameraDeviceMonitor-added"></a><h3>The <code class="literal">“added”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> *monitor,
               <a class="link" href="CheeseCameraDevice.html" title="CheeseCameraDevice"><span class="type">CheeseCameraDevice</span></a>        *device,
               <span class="type">gpointer</span>                   user_data)</pre>
<p>The ::added signal is emitted when a camera is added, or on start-up
after <a class="link" href="CheeseCameraDeviceMonitor.html#cheese-camera-device-monitor-coldplug" title="cheese_camera_device_monitor_coldplug ()"><code class="function">cheese_camera_device_monitor_coldplug()</code></a> is called.</p>
<div class="refsect3">
<a name="CheeseCameraDeviceMonitor-added.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>monitor</p></td>
<td class="parameter_description"><p>the <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> that emitted the signal</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>a new <a class="link" href="CheeseCameraDevice.html" title="CheeseCameraDevice"><span class="type">CheeseCameraDevice</span></a> representing the video capture device</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Action</p>
</div>
<hr>
<div class="refsect2">
<a name="CheeseCameraDeviceMonitor-removed"></a><h3>The <code class="literal">“removed”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> *monitor,
               <a class="link" href="CheeseCameraDevice.html" title="CheeseCameraDevice"><span class="type">CheeseCameraDevice</span></a>        *device,
               <span class="type">gpointer</span>                   user_data)</pre>
<p>The ::removed signal is emitted when a camera is unplugged, or disabled on
the system.</p>
<div class="refsect3">
<a name="CheeseCameraDeviceMonitor-removed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>monitor</p></td>
<td class="parameter_description"><p>the <a class="link" href="CheeseCameraDeviceMonitor.html" title="CheeseCameraDeviceMonitor"><span class="type">CheeseCameraDeviceMonitor</span></a> that emitted the signal</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>device</p></td>
<td class="parameter_description"><p>the <a class="link" href="CheeseCameraDevice.html" title="CheeseCameraDevice"><span class="type">CheeseCameraDevice</span></a> that was removed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Action</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.29.1</div>
</body>
</html>